<?php

session_start();
$number = $_POST['number'];
$sid = $_POST['sid'];
if (empty($_SESSION['id'])){
    echo "<script>alert('未登录!');window.location='login.php';</script>";
}else {
    if ($_SESSION['perssime'] == 1) {
        echo "<script>alert('管理员无法进行购物!');window.location='#';</script>";
    } else {
        include_once("mysql_conn.php");
        (new mysql_conn())->add_upadate("update  shopcart set number=".$number.", flag = 2 where id = ".$sid) ;
//echo "update  shopcart set userid=".$id.",number=".$number.", flag = 2 where id = ".$sid ;
                $_SESSION['sid']=$sid;
        echo "<script>alert('确认成功!');window.location='checkorders.php';</script>";
    }
}
?>